<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>

<body>
    <div id="app">

    </div>
    <script type="text/babel">
    // 组组件需要一个根组件
    function Welcome(props){
        console.log(props);
        function btnClick(){
            console.log(234);
        }
        return (
            <div>
                <p>你好，我是组件</p>
                <p>你好,{props.name}</p>
                <button onClick={btnClick}>按钮</button>
            </div>
            
        );
    };
    var ele =(
        <div>
            <Welcome name="小明"/>    
       
        </div>
    );
        
        ReactDOM.render(
            ele,
            document.getElementById("app")
        )
       

    </script>
</body>

</html>